<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>js字符串之其他处理</title>
</head>
<body>
  <script>
    const name = 'Miracle'
    console.log(name.repeat(3))
    // 电话号码模糊处理
    function mask(mobile, length) {
      return `${String(mobile).slice(0, length * -1)}${'*'.repeat(length)}`
    }
    console.log(mask(13545678910, 3))
    console.log(mask(13545678910, 9))
  </script>
</body>
</html>